package com.itcast.dao;

import com.itcast.domain.Admin;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface AdminDao {
    @Insert("insert into admin(admin,password,tel) values(#{admin},#{password},#{tel})")
    int register(Admin admin);

    @Select("select * from admin where admin = #{admin} and password = #{password}")
    Boolean login(Admin admin);

    @Select("select * from admin")
    List<Admin> findAll();

    @Delete("delete from admin where id = #{id}")
    int deleteAdmin(Integer id);
}
